package com.todod.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.todod.dto.FeaturDto;
import com.todod.entity.QueryEntry;
import com.todod.mapper.FeatureMapper;
import com.todod.model.Featur;
import com.todod.service.FeatureService;

/**
 * 新特性实现类
 * 
 * @author 金鹏飞
 *
 */
@Service
public class FeatureServiceImpl extends ServiceImpl<FeatureMapper, Featur> implements FeatureService {

	@Override
	public void del(Long id) {
		removeById(id);

	}

	@Override
	public void save11(Featur featur) {
		save(featur);

	}

	@Override
	public void update(Featur featur) {
		updateById(featur);

	}

	@Override
	public IPage<FeaturDto> getList(QueryEntry entry) {
		FeatureMapper featureMapper = this.getBaseMapper();
		Page<FeaturDto> page = new Page<>(entry.getPage(), entry.getLimit());
		IPage<FeaturDto> iPage = featureMapper.selectPage(page, entry);
		return iPage;
	}

	@Override
	public Featur selectByname(String name) {
		QueryWrapper<Featur> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("fe_title", name);
		return getOne(queryWrapper);
	}

	@Override
	public List<Featur> getList1() {
		// TODO Auto-generated method stub
		return list();
	}

}
